/* Start writing out the saved-domain record. */
- if ( xcio_write(ioctxt, "LinuxGuestRecord", 16) ||
- xcio_write(ioctxt, &nr_pfns, sizeof(unsigned long)) ||
- xcio_write(ioctxt, pfn_to_mfn_frame_list, PAGE_SIZE) ){
+ if ( xcio_write(ioctxt, "LinuxGuestRecord", 16) ){
xcio_error(ioctxt, "Error writing header");
goto out;
}
xcio_error(ioctxt, "Error writing vmconfig");
goto out;
}
+ if ( xcio_write(ioctxt, &nr_pfns, sizeof(unsigned long)) ||
+ xcio_write(ioctxt, pfn_to_mfn_frame_list, PAGE_SIZE) ){
+ xcio_error(ioctxt, "Error writing header");
+ goto out;
+ }
print_stats( xc_handle, domid, 0, &stats, 0 );
raise XendError("not a valid guest state file: found '%s'" %
signature)
- l = fd.read_exact(sizeof_unsigned_long,
- "not a valid guest state file: pfn count read")
- nr_pfns = unpack("=L", l)[0] # XXX endianess
- if nr_pfns > 1024*1024: # XXX
- raise XendError(
- "not a valid guest state file: pfn count out of range")
-
- pfn_to_mfn_frame_list = fd.read_exact(PAGE_SIZE,
- "not a valid guest state file: pfn_to_mfn_frame_list read")
-
l = fd.read_exact(sizeof_int,
"not a valid guest state file: config size read")
vmconfig_size = unpack("i", l)[0] # XXX endianess
vmconfig = p.get_val()
dominfo = self.domain_configure(vmconfig)
+ l = fd.read_exact(sizeof_unsigned_long,
+ "not a valid guest state file: pfn count read")
+ nr_pfns = unpack("=L", l)[0] # XXX endianess
+ if nr_pfns > 1024*1024: # XXX
+ raise XendError(
+ "not a valid guest state file: pfn count out of range")
+
+ pfn_to_mfn_frame_list = fd.read_exact(PAGE_SIZE,
+ "not a valid guest state file: pfn_to_mfn_frame_list read")
+
# XXXcl hack: fd.tell will sync up the object and
# underlying file descriptor
ignore = fd.tell()